<widget tag="div" class="container widget-last_news-container">
    <div>
        <h1 class="text-center">{$widget.title}</h1>
    </div>

    <div class="row">
        <php>
            $widget["vars"]["last_news_category_id"] = empty($widget["vars"]["last_news_category_id"])?1:$widget["vars"]["last_news_category_id"];
            $last_news_limit=4;
        </php>
        <portal:articles limit="$last_news_limit" order="post.published_time DESC"
                         categoryIds="$widget.vars.last_news_category_id">
            <div class="col-md-3">
                <div class="tc-gridbox">
                    <div class="header">
                        <div class="item-image">
                            <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
                                <present name="vo.more.thumbnail">
                                    <empty name="vo.more.thumbnail">
                                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                             class="img-responsive"
                                             alt="">
                                        <else/>
                                        <img src="{:cmf_get_image_url($vo.more.thumbnail)}"
                                             class="img-responsive"
                                             alt="">
                                    </empty>
                                    <else/>
                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                         class="img-responsive"
                                         alt="">
                                </present>
                            </a>
                        </div>
                        <h3>
                            <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">{$vo.post_title}</a>
                        </h3>
                        <hr>
                    </div>
                    <div class="body">
                        <p>
                            <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">...</a>
                        </p>
                    </div>
                </div>
            </div>
        </portal:articles>
    </div>
</widget>
